//
//  XYTableView.m
//  LabHelper
//
//  Created by 找汽配 on 2017/5/31.
//  Copyright © 2017年 XiangYun. All rights reserved.
//

#import "XYTableView.h"

@implementation XYTableView

- (void)reloadData {
    [super reloadData];
    
    if (self.automaticallyAdjustsHeight) {
        [self removeConstraints:self.constraints];
        NSLayoutConstraint * constraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1 constant:self.contentSize.height];
        [self addConstraint:constraint];
        self.heightConstraint = constraint;
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
